<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>模块排序</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0" />
    <#include "/view/head.html"/>
    <style type="text/css">
        .table-class{
            width:90%;
            text-align: center;
            border:1px solid #afd9ee;
            margin:0 auto;
            margin-top: 50px;
        }
        .list-path{
            height: 50px;
            line-height: 50px;
            background-color: #9acfea;

        }
        table th{
            text-align: center;
        }
        table thead tr {
            background-color: #9acfea;
        }
        .table-query{
            /*height: 40px;*/
            /*width:80px;*/
            /*text-align: center;*/
            white-space:nowrap;

        }
    </style>
    <script type="text/javascript">
    </script>
</head>
<body>

<div class="list-path" > <span style="margin-left: 50px;"><span class="glyphicon glyphicon-home"></span>投票首页模块顺序</span></div>

<div class="table-class">

    <table class="table table-hover" id="tbl">
        <thead>
        <tr>
            <th>序号</th>
            <th>顺序</th>
            <th>别名</th>
            <th>名称</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <#list pagination.list as c>
            <tr>
                <td>${(pagination.pageNo-1)*pagination.pageSize+1+c_index}</td>
                <td>${c.value!}</td>
                <td>${c.name!}</td>
                <td>${c.title!}</td>
                <td>
                    <#if c_index != 0>
                        <button class="before-move btn btn-info" onclick="exchange('${c.dataresourceId!}',-1)" >上移</button>
                    </#if>
                    <#if pagination.list?size-1 != c_index>
                        <button class="after-move btn btn-info" onclick="exchange('${c.dataresourceId!}',1)" >下移</button>
                    </#if>

                </td>
            </tr>


        </#list>
        <#if 0==pagination.totalCount>
            <tr>
                <td colspan="7" style="color: red"> 没有相关数据 </td>
            </tr>
        </#if>




        </tbody>
    </table>
    <ul class="pagination">
        <#if pagination??>
            <#if pagination.pageNo gt 1>
                <li><a href="${base}/approve/list.do?pageNo=1">首页</a></li>
            </#if>
            <#list 5..1 as t>
                <#if (pagination.pageNo-t gt 0)>
                    <li><a href="${base}/approve/list.do?pageNo=#{pagination.pageNo-t}">#{pagination.pageNo-t}</a></li>
                </#if>
            </#list>
            <li><a href="#" style="background-color: #ddd;">#{pagination.pageNo}</a></li>
            <#list 1..5 as t>
                <#if (pagination.totalPage gt pagination.pageNo+t-1)>
                    <li><a href="${base}/approve/list.do?pageNo=#{pagination.pageNo+t}">#{pagination.pageNo+t}</a></li>
                </#if>
            </#list>
            <#if pagination.totalPage gt pagination.pageNo>
                <li><a href="${base}/approve/list.do?pageNo=#{pagination.totalPage}">尾页</a></li>
            </#if>

        </#if>

    </ul>
</div>
<script>
    function exchange(id,sorting){
        location.href="${base}/sorting/exchange.do?id="+id+"&sorting="+sorting;

    }



</script>

</body>
</html>
